import request from '@/utils/request'
import d from 'highlight.js/lib/languages/d'

// 查询供应商管理列表
export function listVendor(query) {
  return request({
    url: '/commodity/vendor/list',
    method: 'get',
    params: query
  })
}

// 查询供应商管理列表
export function listProductVendor(query) {
  return request({
    url: '/commodity/vendor/product/list',
    method: 'get',
    params: query
  })
}

// 查询供应商管理详细
export function getVendor(id) {
  return request({
    url: '/commodity/vendor/' + id,
    method: 'get'
  })
}

// 新增供应商管理
export function addVendor(data) {
  return request({
    url: '/commodity/vendor',
    method: 'post',
    data: data
  })
}

// 新增合同
export function insertTemplates(data) {
  return request({
    url: '/commodity/vendor/insertTemplates',
    method: 'post',
    data: data
  })
}

// 合同详情页面
export function getSelectContractTemplatesByIdr(id) {
  return request({
    url: '/commodity/vendor/selectContractTemplatesById/' + id,
    method: 'get'
  })
}

// 修改合同
export function updateContractTemplates(data) {
  return request({
    url: '/commodity/vendor/updateContractTemplates',
    method: 'put',
    data: data
  })
}

// 修改供应商管理
export function updateVendor(data) {
  return request({
    url: '/commodity/vendor',
    method: 'put',
    data: data
  })
}

// 删除合同
export function deleteByIdInt(id) {
  return request({
    url: '/commodity/vendor/deleteByIdInt/' + id,
    method: 'delete'
  })
}


// 删除供应商管理
export function delVendor(id) {
  return request({
    url: '/commodity/vendor/' + id,
    method: 'delete'
  })
}

// 查看下拉产品分类
export function selectVendorCates() {
  return request({
    url: '/commodity/vendor/vendorTree',
    method: 'get'
  })
}

// 查看下拉支付方式分类
export function selectPayment() {
  return request({
    url: '/commodity/vendor/paymentTree',
    method: 'get'
  })
}

// 生成供应商编号
export function getSelectNumber() {
  return request({
    url: '/commodity/vendor/vendorNumber',
    method: 'get'
  })
}

// 合同模板分类
export function getTemplatesTree() {
  return request({
    url: '/commodity/vendor/templatesTree',
    method: 'get'
  })
}

// 根据选择的模板id来查询内容
export function getSelectTempltesById(id) {
  return request({
    url: '/commodity/vendor/selectTempltesById/' + id,
    method: 'get'
  })
}

// 根据Long[] id来查询所以的数据
export function getSelectVendorListById(id) {
  return request({
    url: '/commodity/vendor/selectVendorList/' + id,
    method: 'get'
  })
}

// 批量修改数据
export function getUpdateList(data) {
  return request({
    url: '/commodity/vendor/batchUpdateContract',
    method: 'post',
    data: data
  })
}

//查询合同信息
export function selectContractTemplatesList(query) {
  return request({
    url: '/commodity/vendor/selectContractTemplatesList',
    method: 'get',
    params: query
  })
}
//导入供应商表格数据
export function importVendorExcel(data) {
  return request({
    url: '/commodity/vendor/importVendorExcel',
    method: 'post',
    data: data
  })
}

